package message

const (
	TypeRegisterReq = "TypeRegisterReq"
	TypeLoginReq    = "TypeLoginReq"
	TypeLoginRes	= "TypeLoginRes"
	TypeSmsReq      = "TypeSmsReq"
	TypeRegisterRes = "TypeRegisterRes"

	NotifyUserStatus = "NotifyUserStatus"
)

// 用户状态
const (
	UserStatusOnline = iota
	UserStatusOffline
	UserStatusBusy
)

type User struct {
	UserId   int64  `json:"user_id"`
	Username string `json:"username"`
	Password string `json:"password"`
	Status   int8   `json:"status"`
}

type Message struct {
	Type string `json:"type"`
	Data string `json:"data"`
}

type RegisterReqMessage struct {
	User User `json:"user"`
}

type LoginReqMessage struct {
	User User `json:"user"`
}

type LoginResMessage struct {
	ResponseMessage
	UserIds []int64
}

type UserStatusMessage struct {
	User User `json:"user"`
}

type SmsMessage struct {
	UserId int64 `json:"user_id"`
	Status int8 `json:"status"`
	Content string `json:"content"`
}

type ResponseMessage struct {
	Code  int    `json:"code"`
	Error string `json:"error"`
}
